<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航页管理系统 - 登录</title>
    <!-- Bootstrap CSS -->
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8f9fa;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .login-container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            padding: 2rem;
            width: 100%;
            max-width: 400px;
        }

        .login-header {
            text-align: center;
            margin-bottom: 2rem;
            color: #2c3e50;
        }

        .login-header h2 {
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .login-header p {
            color: #6c757d;
            margin-bottom: 0;
        }

        .form-control {
            border-radius: 4px;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .form-control:focus {
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
        }

        .btn-login {
            background-color: #3498db;
            border-color: #3498db;
            color: white;
            border-radius: 4px;
            padding: 0.75rem;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .btn-login:hover {
            background-color: #2980b9;
            border-color: #2980b9;
        }

        .login-links {
            display: flex;
            justify-content: space-between;
            margin-top: 1rem;
        }

        .alert {
            border-radius: 4px;
            margin-bottom: 1rem;
        }

        .login-icon {
            color: #3498db;
            font-size: 3rem;
            margin-bottom: 1rem;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-header">
        <div class="login-icon">
            <i class="fas fa-cogs"></i>
        </div>
        <h2>导航页管理系统</h2>
        <p>请登录您的账户</p>
    </div>

    <!-- 错误消息提示 -->
    <div th:if="${error}" class="alert alert-danger" role="alert">
        <i class="fas fa-exclamation-circle me-2"></i>用户名或密码错误！
    </div>

    <form th:action="@{/login}" method="post">
        <div class="mb-3">
            <label for="username" class="form-label">账号</label>
            <div class="input-group">
                <span class="input-group-text"><i class="fas fa-user"></i></span>
                <input type="text" class="form-control" id="username" name="username" placeholder="请输入账号" required autofocus>
            </div>
        </div>

        <div class="mb-3">
            <label for="password" class="form-label">密码</label>
            <div class="input-group">
                <span class="input-group-text"><i class="fas fa-lock"></i></span>
                <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码" required>
            </div>
        </div>

        <button type="submit" class="btn btn-login w-100">
            <i class="fas fa-sign-in-alt me-2"></i>登录
        </button>
    </form>
</div>

<!-- Bootstrap JS -->
<script th:src="@{/js/bootstrap.js}"></script>
</body>
</html>